function atom(params) {
	const http = require('http');
	const ipAddress = params.ipAddress;
	//根据客户端IP获取其地址信息
	const server_address = "http://ip.taobao.com/service/getIpInfo.php?ip="+ipAddress;//淘宝IP地址库
	return new Promise((resolve, reject) => {
		const req = http.get(server_address, (rs) => {
			let buf = "";
			rs.on('data', (chunk) => {
				buf+=chunk;
			});
			rs.on('end', (d) => {
				buf=JSON.parse(buf);
				if(buf.code==0){
					const data=buf.data;
					const info={
						ip:data.ip,
						country_id:data.country_id,
						area_id:data.area_id,
						country_id:data.country_id,
						region_id:data.region_id,
						city_id:data.city_id,
						county_id:data.county_id,
						isp_id:data.isp_id,
						country:decodeURI(data.country),
						area:decodeURI(data.area),
						region:decodeURI(data.region),
						city:decodeURI(data.city),
						county:decodeURI(data.county),
						isp:decodeURI(data.isp),
						cip:data.ip
					};
					resolve(info);
				}else{
					resolve({ip:ipAddress});
				}
			});
		});
		req.on('error', (e) => {
			resolve({ip:ipAddress});
		});
	});
}
exports.spaceid = 'bjfeidao_351';
const params = {
	ipAddress: '61.163.79.140'//'127.0.0.1'//
};
exports.productid = 'feidao_public';
//'210.75.225.254'//

const code = atom.toString();
exports.code = code;
if (require.main === module) {
	const iv = require('../dist/invoke');
	iv.default({ code, params }).then((rc) => {
		console.log(rc);
	}, (err) => {
		console.error(err);
	});
}
